package circuits;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class ComposedComponent extends Component{

	private Collection<Component> components;
	
	public ComposedComponent(){
		this.components = new ArrayList<Component>();
	}
	
	@Override
	public void generateOutput() {
		Iterator<Component> componentsIterator = this.components.iterator();
		while(componentsIterator.hasNext()){
			Component component = componentsIterator.next();
			component.generateOutput();
		}
	}
	
	@Override
	public void readInputValues() {
		Iterator<Component> componentsIterator = this.components.iterator();
		while(componentsIterator.hasNext()){
			Component component = componentsIterator.next();
			component.readInputValues();
		}
	}

}
